package hy.demo1;

import hy.demo1.impl.Fxg;
import hy.demo1.impl.Ms;
import hy.demo1.impl.Tw;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestApp {
    public static void main(String[] args) {
        Performer p1=new Ms();
        Performer p2=new Tw();
        Director d=new Fxg(p2);
        d.startPerform();
    }

    @Test
    public void test2() throws InterruptedException {
        //读取配置文件　
        ClassPathXmlApplicationContext a=new ClassPathXmlApplicationContext("demo1/day1_demo1.xml");
        //Director d= (Director) a.getBean("fxg");
        //d.startPerform();
        //System.out.println(a.getBean(Ms.class).getName());
        //a.destroy();
        //a.close();
        //System.out.println(a.getBean(Ms.class) == a.getBean(Ms.class));
        a.registerShutdownHook();
        //Thread.sleep(5000);



    }
}
